<?php
include('../includes/config.php');
$id = $_GET['id'];
$sql = "select * from orders where id=$id";
$r = $db->getRow($sql);
if($r['has_child'])
	echo $id;
else
	echo 0;
?>